import { createSlice } from '@reduxjs/toolkit'

 const CitySlice = createSlice({
  name: 'CitySlice',
  initialState:{
    start:"北京",
    end:"广州",

  },
  reducers: {
    editCity(state,{payload}){
        state[payload.type]=payload.city
    }
  },
})

// Action creators are generated for each case reducer function
export const { editCity } = CitySlice.actions

export default CitySlice.reducer